<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>字符串倒置</title>
  <script>
    //7. 编写函数rev(char) 实现将字符串char倒置，比如rev("spring") 返回"gnirps"
    function work7(x) {
      //先转数组，后倒置，再转字符串
      return x.split('').reverse().join('');
    }
    work7('1234567890');
  </script>
</head>

<body>
  !
</body>

</html>